var path = require('path')
var webpack = require('webpack')

module.exports = {

  entry: path.resolve(__dirname, './client/src/app.js'),

  output: {
    path: path.resolve(__dirname, 'client/dist'),
    filename: 'bundle.js'
  },

  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel?presets=es2015'
      },
      {
        test: /\.vue/,
        loader: 'vue'
      }
    ]
  },
  babel: {
    presets: ['es2015']
  },
  resolve: {
    extensions: ['', '.js', '.vue']
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      mangle: {
        except: ['$super', '$', 'exports', 'require']
        //以上变量‘$super’, ‘$’, ‘exports’ or ‘require’，不会被混淆
      },
      compress: {
        warnings: false
      }
    })
  ]

}